def binarySearch(li,item):
    n = len(li)
    first = 0
    last = n - 1
    while first <= last:
        mid = int((first+last)/2)
        if li[mid] == item:
            return True
        elif li[mid] > item:
            last = mid - 1
        else:
            first = mid + 1
    return False

testlist = [0, 1, 2, 8, 13, 17, 19, 32, 42,]
print(binarySearch(testlist, 3))
print(binarySearch(testlist, 13))